﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace web9
{
    public partial class _2016020719_1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void GridView1_RowDateBound(object sender, GridViewRowEventArgs e)
        {
            if ((e.Row.RowState &DataControlRowState.Edit) <= 0)
            {
                if(e.Row.RowType == DataControlRowType.DataRow)
                {
                    string createTime = e.Row.Cells[2].Text;
                    TimeSpan ts = DateTime.Now.Subtract(DateTime.Parse(createTime));
                    Label lblDays = (Label)e.Row.FindControl("Label1");
                    lblDays.Text = ts.Days.ToString("#,##0");
                }
            }
        }

       
        
    }
}